<template>
    <view class="page-wrap">
        <view class="title">{{info.title}}</view>
        <view class="time">
            <u-icon name="clock" :color="color['ico-color']" size="28"></u-icon>
            发布时间：{{info.createDate}}
        </view>
        <view class="content">
            <u-parse :content="info.content" :show-with-animation="true" :lazy-load="true" />
        </view>
    </view>
</template>

<script>
    export default {
        data() {
            return {
                info: {}
            };
        },
        computed: {},
        methods: {
            refresh(paging) {
                setTimeout(() => {
                    this.list = [];
                    for (let i = 0; i < paging.size; i++) {
                        this.list.push(i);
                    }
                    // 刷新成功
                    this.$refs.list.refreshSuccess({
                        list: this.list,
                        total: 30
                    });
                    // 刷新失败
                    // this.$refs.list.refreshFail();
                }, Math.random() * 1000);
            }
        },
        watch: {},
        onLoad(option) {
            option.id && this.$api.common.noticeDetail({
                id: option.id
            }).then(res => {
                this.info = res.info
            })
        },
        onShow() {},
        onHide() {},
        onUnload() {},
        onReachBottom() {},
        onPageScroll(event) {},
        onPullDownRefresh() {},
        onShareAppMessage(options) {}
    };
</script>

<style lang="scss">
    .page-wrap {
        background: #fff;
        padding: 0 32rpx;
        font-size: 32rpx;

        .title {
            text-align: center;
            padding: 16rpx 0;
        }

        .time {
            font-size: 28rpx;
            color: #666;
            padding: 16rpx 0 32rpx 0;
            margin-bottom: 16rpx;
            border-bottom: 1rpx solid #eee;

            ::v-deep .u-icon {
                display: inline-block;
                margin-right: 0.5em;
            }
        }
    }
</style>